<template>
  <div class="chat-container">
    <TopNav />
    <!-- 训练 -->
    <div class="topImg">
      <a href="/" class="gotoSub"> <img src="../../assets/home.png" alt="" style="width: 100%" /></a>
    </div>
    <div class="AllCont">
      <div class="contAllThree">
        <div class="AllOne">
          <div class="dt">
            <img src="@assets/chat/title-1.png" alt="" />AI工具服务
            <!-- <div class="dd">换一批</div> -->
          </div>
          <div class="liBox">
            <div class="ul">
              <div class="li" v-for="(item, index) in listData" :key="index" @click="goToPage(item)">
                <!-- <div class="mask"></div> -->
                <img :src="item.img" alt="" />
                <span>{{ item.title }}</span>
              </div>
            </div>
          </div>
        </div>
        <div class="AllOne">
          <div class="dt"><img src="@assets/chat/title-2.png" alt="" />你可以这样问我</div>
          <div class="question-list">
            <div class="question-item" v-for="(item, index) in listData1" :key="index">
              <div class="title">{{ item.title }}</div>
              <div class="question" v-for="(data, index) in item.content" :key="index + 'a'" @click="goToChat(data)">
                {{ data.cont }}<img :src="item.img" alt="" />
              </div>
            </div>
          </div>
        </div>
        <div class="AllOne">
          <div class="dt"><img src="@assets/chat/title-3.png" alt="" />问答</div>
          <div class="step-list">
            <div>
              <div class="step-item" @click="goToPage({ path:''})">
                <img src="@assets/chat/upload.png" />
                <div class="step-info">
                  <div class="step-title">上传文档</div>
                  <div class="step-content">建立专属业务知识文档</div>
                </div>
              </div>
              <div class="step-arrow"><img src="@assets/chat/down.png" /></div>
            </div>
            <div>
              <div class="step-item" @click="goToPage({ path:'/chatgpt/ChatModel'})">
                <img src="@assets/chat/jmen.png" />
                <div class="step-info">
                  <div class="step-title">与机器人对话</div>
                  <div class="step-content">开启专业领域问答</div>
                </div>
              </div>
              <!---->
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 训练结束 -->

    <!-- <a-tabs defaultActiveKey="1" @change="callback">
      <a-tab-pane tab="AI聊天" key="1" >

      </a-tab-pane>
      <a-tab-pane tab="AI绘画" key="2" forceRender>

      </a-tab-pane>
      <a-tab-pane tab="AI训练" key="3" forceRender>

      </a-tab-pane>
    </a-tabs> -->
    <!-- 聊天内容 -->
  </div>
</template>
  
<script>
import TopNav from './component/TopNav.vue'
export default {
  name: 'ChatModelTrain',
  mixins: [],
  components: {
    TopNav,
  },
  data() {
    return {
      listData: [
        {
          img: require('@assets/chat/liaotian.png'),
          title: '聊天',
          path: '/chatgpt/ChatModel',
        },
        {
          img: require('@assets/chat/huihua.png'),
          title: '绘画',
          path: '/chatgpt/ChatModelDraw',
        },
        {
          img: require('@assets/chat/caiji.png'),
          title: '文案',
          path: '/chatgpt/application/CommerceProducts',
        },
        {
          img: require('@assets/chat/zongzuojihua.png'),
          title: '工作计划',
          path: '/chatgpt/application/WorkPlan',
        },
        {
          img: require('@assets/chat/zongjiebaogao.png'),
          title: '总结报告',
          path: '/chatgpt/application/WorkPlanReprt',
        },
        {
          img: require('@assets/chat/zhoubao.png'),
          title: '周报',
          path: '/chatgpt/application/DailyWeekly',
        },
      ],
      listData1: [
        {
          img: require('@assets/chat/point.png'),
          title: '健康助手',
          content: [{ cont: '“冻了2年的羊肉还能吃吗？' }, { cont: '“寄生虫病有多可怕？”' }],
        },
        {
          img: require('@assets/chat/point.png'),
          title: '工作助手',
          content: [{ cont: '“工作怎么样安排时间？' }, { cont: '“人每天工作多少个小时最合适？”' }],
        },
      ],
      
    }
  },
  mounted() {
     this.$notification.warn({
            message: '提示',
            description: `请注册登录，查看更多内容`,
            duration:5
          });
  },
  beforeDestroy() {
    //清除定时器
    clearInterval(this.timer)
    this.timer = null
  },
  methods: {
    goToChat(item) {
      this.$router.push({ path: '/user' })
    },
    goToPage(item) {
      this.$router.push({ path: '/user' })
    },
  },
}
</script>
  
  <style lang="less" scoped >
.chatFunction {
  float: left;
  width: 100%;
  padding-top: 10px;
  position: relative;
}
.chat-atn {
  &.pop {
    color: #7a46fc;
    background: transparent;
    border-color: #7a46fc;
  }
  &.middle {
    height: 35px;
    padding: 0 23px;
    line-height: 35px;
    float: left;
    margin-right: 10px;
  }
}

.chat-messages {
  display: flex;
  align-items: center;
  margin: 12px 0 20px 0;
  float: left;
  width: 100%;
  .chat-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    border-radius: 8px;
    height: 60px;
    line-height: 20px;
    padding: 10px 20px;
    box-shadow: 0 5px 25px #193e7b14;
    margin-right: 10px;
  }
}

.chat-atn {
  border-radius: 4px;
  line-height: 1.5715;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  touch-action: manipulation;
  height: 32px;
  padding: 4px 15px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.25);
  background: #f5f5f5;
  border-color: #d9d9d9;
  text-shadow: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  &.disable {
    cursor: not-allowed;
  }
  &.active {
    background: #7a46fc;
    border-color: #7a46fc;
    color: white;
    cursor: pointer;
  }
  .iconfont {
    margin-right: 5px;
  }
}
.chat-atn:hover {
  opacity: 0.7;
}
.chat {
  height: 450px;
  overflow-y: auto;
  .classify.right {
    width: 100%;
    text-align: right;
    display: block;
    .chatBox {
      width: 100%;
      display: flex;
      flex-direction: row-reverse;
    }
    .message {
      float: right;
    }
    img {
      margin-left: 10px;
    }
    .message-text {
      text-align: left;
      &.active {
        // background: linear-gradient(to bottom,blue,red);
        animation-name: blink;
        animation-duration: 5s;
      }
      @keyframes blink {
        0% {
          opacity: 1;
          color: red;
        }
        50% {
          opacity: 0.8;
          color: red;
        }
        70% {
          opacity: 0.6;
        }
        100% {
          opacity: 1;
        }
      }
    }
    .iconList {
      margin-right: 10px;
    }
  }
  .classify.left {
    .message {
      float: left;
    }
    img {
      margin-right: 10px;
    }
    .iconList {
      margin-left: 10px;
    }
  }
  .classify {
    margin-bottom: 20px;
    float: left;
    width: 100%;
    .chatBox {
      display: flex;
      align-items: center;
      .chat-header {
        float: left;
        img {
          width: 40px;
          height: 40px;
        }
      }
      .messages {
        max-width: 80%;
        float: left;
        .message {
        }
      }
    }
  }
  .message-text {
    background-color: #f7f7f7;
    padding: 10px 20px;
    border-radius: 8px;
    color: #24292f;
    font-size: 15px;
  }
}
.iconList {
  .iconDt {
    background: #f7f7f7;
    border-radius: 20px;
    height: 30px;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.ant-btn {
  border: unset;
  border-color: unset;
}
.loading {
  width: 22px;
  height: 22px;
  border: 2px solid #1890ff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rotate 0.75s linear infinite;
  float: right;
  margin-left: 4px;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

// AI绘画
.middle_con {
  padding: 20px 20px 0 20px;
  .middle_top {
    width: 100%;
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    .main_image {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 20px;
      .image_container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        img {
          width: 200px;
          height: 200px;
          -o-object-fit: cover;
          object-fit: cover;
        }
        .title {
          color: #333;
          font-size: 16px;
          font-weight: 600;
        }
        .desc {
          color: #999;
          margin-top: 10px;
        }
      }
    }
  }
}
.main_sc {
  width: 320px;
  height: 320px;
  img {
    width: 100%;
    border: none;
  }
}

.main_sc .message-text {
  background-color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
}
.fixBoom {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 100px;
  color: black;
  background: transparent;
  border: 1px solid black;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
}
.fixBoom:hover {
  opacity: 0.7;
}
.topImg {
  padding-top: 12px;
  float: left;
  background: #f6f6f6;
}

.contAllThree {
  float: left;
  width: 100%;
  .liBox {
    display: flex;
    align-content: center;
  }
  .ul {
    margin-top: 20px;
    margin-left: -1%;
    margin-right: -1%;
    .li {
      cursor: pointer;
      width: 31.33%;
      height: 150px;
      text-align: center;
      line-height: 150px;
      border-radius: 8px;
      position: relative;
      margin: 1%;
      float: left;
      .mask {
        position: absolute;
        top: 2px;
        left: 0;
        width: 100%;
        text-align: center;
        padding-top: 150px;
        border-radius: 8px;
        background-color: #000;
        opacity: 0.7;
      }
      img {
        width: 100%;
        height: 100%;
        border-radius: 9px;
      }
      span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 80%;
        transform: translate(-50%);
        color: #cbd5e1;
        font-size: 18px;
        padding-top: 60px;
        border-radius: 8px;
        background-color: #000;
        padding: 2px 10px;
        line-height: 30px;
        margin-top: -15px;
        background: #0f121c;
        box-shadow: 0 4px 14px 0 rgba(0 0 0 / 50%);
      }
    }
    .li:nth-child(3n) {
      margin-right: 0;
    }
    .li:hover {
      opacity: 0.7;
    }
  }
}

.question-list {
  padding: 10px;
  .title {
    font-size: 14px;
    font-weight: 400;
    color: #414141;
    margin: 15px 0;
  }
  .question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f5ff;
    box-shadow: 0px 2px 6px 0px #e7e7e7;
    border-radius: 10px;
    padding: 20px 10px;
    margin: 10px 0;
    cursor: pointer;
    font-size: 16px;
    color: black;
    img {
      width: 24px;
      height: 24px;
    }
  }
}

.step-list {
  padding: 10px;
  img {
    width: 30px;
  }
  .step-item {
    background: #f0f5ff;
    border-radius: 10px 10px 10px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px 0;
    margin: 10px 0;
    cursor: pointer;
    .step-info {
      margin-left: 10px;
      .step-title {
        font-size: 16px;
        font-weight: 600;
        color: #414141;
        margin-bottom: 7px;
      }
      .step-content {
        font-size: 12px;
        font-weight: 400;
        color: #999999;
      }
    }
  }
  .step-arrow {
    margin: 30px 0;
    text-align: center;
    img {
      width: 50px;
    }
  }
}


@media screen and (max-width: 767px) {
  .banner{
    display: none;
  }
  .contAllThree{
    display: inline-block;
    margin-top: 0;
    .AllOne{
      width: 100%;
      margin-bottom: 20px;
      overflow:unset
    }
    .ul{
      .li{
        height: 100px;
        line-height: 100px;
        span{
          font-size: 14px;
        }
      }
    }
  }
}
</style>
  